import { get, post, del } from "@/utils/request";
import {
  type CompanyList,
  type branchAddParams,
  type CompanyListReturn,
  type addData,
} from "./type";

//列表
export const getCompanyList = (data: CompanyList) => {
  return get<CompanyList, CompanyListReturn>("/api/company/list", data);
};

// 添加

export const AddBranch = (data: branchAddParams) => {
  return post<branchAddParams, addData>("/api/company/add", data);
};
// 修改
export const addcountgUpdate = (data: branchAddParams) => {
  return post<branchAddParams, addData>("/api/company/add", data);
};
//删除
export const delCompany = (id: number) => {
  return del<number, null>(`/api/company/delete/${id}`);
};
//批量删除
export const delMany = (ids: number[]) => {
  return post<number[], null>("/api/company/deleteAll", ids);
};
// 省份

export const companyGetcityAPI = () => {
  return get<number[], null>("/api/company/getCity");
};
